package fr.uniscol.siecle.model;

import java.io.Serializable;
import java.io.ObjectInputStream.GetField;
import java.util.ArrayList;
import java.util.List;

import org.hibernate.mapping.Array;

public class Service implements Serializable, DonneeSiecle {

	private Division division = null;
	
	private Matiere matiere = null;
	
	private List<ServiceEnseignant> servicesEnseignant = null;
	
	private ModaliteCours modaliteCours = null;
	
	private float heureStructure = 0.0f;
	
	private boolean coEnseignement = false;
	
	private String type = null;

	public Service() {
		super();
	}

	public Service(Division division, Matiere matiere, ModaliteCours modaliteCours) {
		super();
		this.division = division;
		this.matiere = matiere;
		this.modaliteCours = modaliteCours;
	}

	public Division getDivision() {
		return division;
	}

	public void setDivision(Division division) {
		this.division = division;
	}

	public Matiere getMatiere() {
		return matiere;
	}

	public void setMatiere(Matiere matiere) {
		this.matiere = matiere;
	}

	public List<ServiceEnseignant> getServicesEnseignant() {
		if(servicesEnseignant == null){
			servicesEnseignant = new ArrayList<ServiceEnseignant>();
		}
		return servicesEnseignant;
	}

	public void setServicesEnseignant(List<ServiceEnseignant> servicesEnseignant) {
		this.servicesEnseignant = servicesEnseignant;
	}

	public ModaliteCours getModaliteCours() {
		return modaliteCours;
	}

	public void setModaliteCours(ModaliteCours modaliteCours) {
		this.modaliteCours = modaliteCours;
	}

	public float getHeureStructure() {
		return heureStructure;
	}

	public void setHeureStructure(float heureStructure) {
		this.heureStructure = heureStructure;
	}

	public boolean isCoEnseignement() {
		return coEnseignement;
	}

	public void setCoEnseignement(boolean coEnseignement) {
		this.coEnseignement = coEnseignement;
	}

	public String getType() {
		return type;
	}

	public void setType(String type) {
		this.type = type;
	}

	@Override
	public boolean equals(Object obj) {
		Service s = (Service)obj;
		return getDivision().equals(s.getDivision())
		&& getMatiere().equals(s.getMatiere())
		&& getModaliteCours().equals(s.getModaliteCours());
	}
}
